Skip to content

Conversation

@avandras
Copy link

To implement patronictl multisite-switchover

? probably more sensible to call it site-switchover instead?

@ants ants force-pushed the ctl-switchover-only branch from f96fc12 to 482e68c Compare May 15, 2025 13:29
click.echo('Current cluster topology')
output_members(cluster, cluster_name, group=group)

if is_citus_cluster() and group is None:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Citus will be quite unhappy if some nodes don't have a local leader. Correct fix is probably to have a single point that determines which site is active for the whole cluster. But that is a larger job. I think for now we should just have an error saying that citus and multisite together is unsupported.

# multisite_cluster = multisite_dcs.get_cluster()

candidate_names = [str(m.multisite['name']) for m in cluster.members
if m.multisite and m.multisite['name'] != leader_site]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should not work, the other sites members are not listed in this sites DCS. Meaning candidate_names will only contain the site name that this is executed on. This is only correct when executed on standby site in a 2 node cluster.

switchover_value = {'candidate': candidate}

if scheduled_at_str:
switchover_value['scheduled_at'] = scheduled_at_str
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value is ignored by the multisite code. Scheduled switchover is not yet implemented.

@ants ants merged commit 76048a7 into multisite May 23, 2025
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants